\documentclass[12pt]{article}
\usepackage[top=2.5cm, bottom=2.5cm, left=2.5cm, right=2.5cm]{geometry}
\usepackage[pdfborder={0 0 0}]{hyperref}
\begin{document}

\begin{center}
\section*{Tools Setup \& Use Guide}

Embedded Systems Team

Evan Arnold, Edmund Chu, Chris Hale, Martin Young

Revision 10 Oct 2010
\end{center}

\subsection*{Sun SPOT Manager Installation}
\subsubsection*{Installing on Ubuntu "Lucid" 10.04}
Note: While the Sun SPOT Manager will run on 64bit Linux, the driver used to communicate with the SPOTs will become a showstopper when attempting to deploy software to the SPOTs. To avoid this, use 32bit Linux.
\begin{enumerate}
\item
If not already installed, install the following packages using either \textit{apt-get} or the \textit{Synaptic Package Manager}:
\begin{itemize}
\item
Java JDK and JRE $\to{}$ \textit{openjdk-6-jdk} and \textit{openjdk-6-jre}

(Installing the JDK should include the JRE and other required for you.)
\item
Apache Ant $\to{}$ \textit{ant} or \textit{ant1-8}
\end{itemize}
\item
Obtain the latest Sun SPOT Manager tool from \url{http://www.sunspotworld.com/SPOTManager/}
\item
Run the downloaded file (\textit{SPOTManager.jnlp}). It should run with Java by default if using GNOME. You do not need to run the SPOT Manager as an admin.
\begin{enumerate}
\item
A security warning will pop asking to run the application. Select "Run."
\item
An image of a Sun SPOT device should appear while the program loads. (It will update itself and the sdk if out of date.) Once loaded, scroll down to the end so that the "Start..." button enables and click it.
\item
Make sure to select "Yes" when it asks to install NetBeans, modules for NetBeans, and the SDK. Note that NetBeans and the SDK will install on your user profile by default.
\end{enumerate}
\item
Once all the checks go through, it will congratulate you, and the Sun SPOT Manager should now be available for use.
(Double check that it indeed recognizes all installed software by closing it and running it again.)
\end{enumerate}

\subsection*{Using the Sun SPOT Manager}
For our purposes, the manager is primarily used for upgrading firmware and launching the emulator.
\subsubsection*{Upgrading Firmware}
In order to deploy software to the Sun SPOTS, they must first be upgraded to the latest version.
\begin{enumerate}
\item
Run the Sun SPOT Manager and plug in a Sun SPOT or basestation via USB.
\item
Select the "Sun SPOTS" tab.
Choose the device from the "Select a Sun SPOT" dropdown box.
(If the device you want is not there, click the "Refresh" button.
You may also need to unplug and plug back in the device\footnote{Do not touch the operational end of the device. Do not look directly at the operational end of the device. Do not submerge the device in liquid, even partially.}.)
\item
Click the "Upgrade" button to begin the upgrade process.
Press the reset button on the SPOT when asked to.
\end{enumerate}
This entire process may take some time.

\subsection*{Using the Solarium Emulator}
The SunSPOT emulator is installed along with the SDK. There are two ways to launch the Solarium Emulator:
\begin{itemize}
\item
By command line, navigate to the directory of your SDK. Type: \textit{ant solarium}
\item
Launch the Sun SPOT Manager. Click on the Solarium tab.

If you only want to work with emulated SunSPOTs, simply click on the Solarium button to launch the emulator.

If you have a physical SunSPOT basestation connected to your computer, you can have emulated SunSPOTs interact with physical SunSPOTs inside the emulator; select the basestation from the Select a SunSPOT menu. Finally, click on the Solarium button to launch the emulator.

\end{itemize}

Once the emulator starts, you can create a virtual SunSPOT by opening the Emulator menu in the menubar and selecting New Virtual SPOT.

\begin{itemize}
\item
The emulated SunSPOT will appear in the grid in the right hand pane. You can deploy software to the virtual SunSPOT, and it will function much like a real device. To deploy software, right click on the virtual SunSPOT and select Deploy Midlet Bundle. Navigate to source code folder and select the build.xml file. The emulator will compile and build your software and deploy it on the virtual SunSPOT. To start the actual SunSPOT program, right click on the SunSPOT image, and select your program from the Run Midlet menu.

\item
You can also adjust various environment parameters, such as temperature, light, and accelerometer motion. Right click on the SunSPOT and select Display Sensor Panel. From here, you can use the sliders to adjust the environmental inputs to the SunSPOT.

\item
To view the SunSPOT's console output, right click on the SunSPOT and select an option from the Display application output menu.

\item
The SunSPOT SDK comes with a number of demos that are compatible with the emulator. These can be found in the SunSPOT/SDK/Demos folder.

\end{itemize}

\subsubsection*{Using host applications with the Solarium Emulator}

Host applications allow a SunSPOT to communicate with a computer via the basestation. In order to retrieve data from a SunSPOT and use it on a computer, the computer must be running a host application. To use a host application in conjunction with the emulator, use the command line to navigate to the folder containing your host application's build.xml file and run these commands:

\textit{ant host-compile}

\textit{ant host-run -Dbasestation.shared=true -Dbasestation.not.required=true}

This will compile and start your host application. You can then start the SunSPOT emulator and use virtual SunSPOTs to send data to the host application.

\subsection*{Using Netbeans with devices}
\begin{enumerate}
\item
Once you have Netbeans open, select "File $\to{}$Open Project" and navigate to the project you want to open.
\item
Select the project you want to use from the project view pane, right click the name of the project, and select "Clean and Build."  The output pane should read "Build Successful"
\item
\begin{itemize}
\item
If deploying to a Sun SPOT: With the Sun SPOT plugged in via USB, right click the project, and select "Deploy to Sun SPOT." If deployment fails, you may also need to unplug and plug back in the Sun SPOT.
\item
If running with the basestation: With the basestation plugged in via USB, right click the project, and select "Run."
\end{itemize}
\end{enumerate}

\end{document}